import { defineStore } from 'pinia'
import { getEntireDepartment, getEntireMenus, getEntireRoles } from '@/service/main/main'

interface IMainState {
  entireRoles: any[]
  entireDepartment: any[]
  entireMenus: any[]
}

const useMainStore = defineStore('main', {
  state: (): IMainState => ({
    entireRoles: [],
    entireDepartment: [],
    entireMenus: []
  }),
  actions: {
    async fetchEntireDataAction() {
      // const rolesRes = await getEntireRoles()
      // const departmentRes = await getEntireDepartment()
      // const menusRes = await getEntireMenus()
      //
      // this.entireRoles = rolesRes.data.list
      // this.entireDepartment = departmentRes.data.list
      // this.entireMenus = menusRes.data.list
    }
  }
})

export default useMainStore
